﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<HYBYSoft.Company.Models.Article>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Index
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">           
        <div id="div_list">
            <%if (Model.Count() == 0)
              {
                  Html.RenderPartial("partialNoneDate");
              }
              else
              {%>
            <% var grid = new WebGrid(source: Model, rowsPerPage: 3, canSort: false); %>
            <%=grid.GetHtml(tableStyle: "grid", headerStyle: "header", rowStyle: "row", alternatingRowStyle: "alt", footerStyle: "footer", displayHeader: false,
                    mode: WebGridPagerModes.All, firstText: "首页", previousText: "上一页", nextText: "下一页", lastText: "尾页",
                    columns: grid.Columns(
                                      grid.Column(format: (item) => Html.Raw("<img src='" + ((Article)((WebGridRow)item).Value).Icon + "' width=150 height=100 />"), style: "imagecolumn"),
                                      grid.Column(format: (item) => Html.Raw(@"<table cellpadding='0' cellspacing='10' border='0' width='100%'>
                                                                                    <tr>
                                                                                        <td>" + Html.ActionLink(((Article)((WebGridRow)item).Value).Title, "Details", new { id = ((Article)((WebGridRow)item).Value).ArticleID }) +
                                                                                        @"</td>
                                                                                    </tr>
                                                                                    <tr>
                                                                                        <td>" + ((Article)((WebGridRow)item).Value).Description +
                                                                                        @"</td>
                                                                                    </tr>
                                                                                </table>"), style: "row_vertical")
                    ))
            %>        
        <%} %>
        </div>    
</asp:Content>
